<?php
/**
 *
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       app.View.Layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 */

$cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework');
?>
<!DOCTYPE html>
<html>
<head>
	<?php echo $this->Html->charset(); ?>
	<title>
		<?php echo $title_for_layout; ?>
	</title>
	<?php
		echo $this->Html->meta('icon');

		echo $this->Html->css('cake.generic');
		
		echo $this->Html->css('bootstrap-theme');
		echo $this->Html->css('bootstrap-theme.min');
		echo $this->Html->css('bootstrap');
		echo $this->Html->css('bootstrap.min');		

		echo $this->fetch('meta');
		echo $this->fetch('css');
		echo $this->fetch('script');
	?>
</head>

<body style="padding:10px;">
	
	<?php if ($this->Session->read('User') != null) { ?>
		
		<nav class="navbar navbar-inverse" role="navigation">
			<div class="container-fluid">
			
				<!-- Brand and toggle get grouped for better mobile display -->
				<div class="navbar-header">
					<a class="navbar-brand" href="<?php echo $this->webroot; ?>">Administrator</a>
				</div>
				
				<!-- Collect the nav links, forms, and other content for toggling -->
				<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
					<ul class="nav navbar-nav">
						
						<?php if (strpos($this->here, 'category') != false) { ?>
							<li class="active">
						<?php } else { ?>
							<li>
						<?php } ?>						
							<a href="<?php echo $this->webroot; ?>category">Category</a>
						</li>
						
						<?php if (strpos($this->here, 'product') != false) { ?>
							<li class="active">
						<?php } else { ?>
							<li>
						<?php } ?>	
							<a href="<?php echo $this->webroot; ?>product">Product</a>
						</li>		
						
						<?php if (strpos($this->here, 'contact') != false) { ?>
							<li class="active">
						<?php } else { ?>
							<li>
						<?php } ?>	
							<a href="<?php echo $this->webroot; ?>contact">Contact</a>
						</li>
						
						<?php if($this->Session->read('User.Member.type') == '0') { ?>
							<?php if (strpos($this->here, 'member') != false) { ?>
								<li class="active">
							<?php } else { ?>
								<li>
							<?php } ?>	
								<a href="<?php echo $this->webroot; ?>member">Member</a>
							</li>
						<?php } ?>
									
					</ul>				
					
					<p class="navbar-text navbar-right"><a href="<?php echo $this->webroot; ?>contact">Inbox <span class="badge"><?php echo $total; ?></span></a></p>
					
					<p class="navbar-text navbar-right"><a href="<?php echo $this->webroot; ?>auth/logout" class="navbar-link">Logout</a></p>
					<p class="navbar-text navbar-right">Signed in as <a href="#" class="navbar-link"><?php echo $this->Session->read('User.Member.email'); ?></a></p>
				</div>
				
				<!-- /.navbar-collapse -->
				
			</div>
			<!-- /.container-fluid -->
		</nav>
		
	<?php } ?>
	
	
		<?php echo $this->fetch('content'); ?>
	
</body>
</html>
